package com.day0927.Rental_cars;

import java.util.Scanner;

public class Manager {
    Scanner input = new Scanner(System.in);
    Vehicle vehicle = new Vehicle();
    Car[] car = new Car[4];
    Bus[] bus = new Bus[4];
    public void init(){
        Car car1 = new Car("宝马","京NY28588",800,"X6");
        Car car2 = new Car("宝马","京CNY3284",600,"550i");
        Car car3 = new Car("别克","京NT37465",300,"林荫大道");
        Car car4 = new Car("别克","京NT96968",600,"GL8");
        car[0] = car1;
        car[1] = car2;
        car[2] = car3;
        car[3] = car4;
        Bus bus1 = new Bus("金杯","京6566754",800,"16座");
        Bus bus2 = new Bus("金龙","京8696997",800,"16座");
        Bus bus3 = new Bus("金杯","京9696996",1500,"32座");
        Bus bus4 = new Bus("金龙","京8696998",1500,"32座");
        bus[0]  = bus1;
        bus[1]  = bus2;
        bus[2]  = bus3;
        bus[3]  = bus4;

    }


    public void showMenu(){
        System.out.println("***********欢迎光临腾飞汽车租赁公司***********");
        System.out.println("1、轿车 \t2、客车");
        System.out.print("请选择你要租赁的汽车类型：");
        int vehicel_type=input.nextInt();
//        String brand="";//品牌
//        String type="";//型号
        int seat=0;//座位号
        double total_money = 0;//租赁费用
        if(vehicel_type == 1){
            System.out.print("请选择你要租赁的汽车品牌：1、别克 2、宝马");
            int vehicel_brand=input.nextInt();
            if(vehicel_brand == 1){
                //brand="别克";
                System.out.print("请选择你要租赁的汽车类型：1、林荫大道 2、GL8");
                int choose_type = input.nextInt();
                System.out.print("请输入您要租赁的天数：");
                int days=input.nextInt();

                if (choose_type == 1){
                    total_money = car[2].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是："+car[2].getV_number());
                }else if (choose_type == 2){
                    total_money = car[3].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是："+car[3].getV_number());
                }
                System.out.println("您需要支付的租赁费用是："+total_money+"元。");

            }else if(vehicel_brand==2){
               // brand="宝马";
                System.out.print("请选择你要租赁的汽车类型：1、X6  2、550i");
                int choose_type = input.nextInt();
              //  type=(input.nextInt()==1)?"X6":"550i";
                System.out.print("请输入您要租赁的天数：");
                int days=input.nextInt();
                if (choose_type == 1){
                    total_money = car[0].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是："+car[0].getV_number());
                }else if (choose_type == 2){
                    total_money = car[1].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是："+car[1].getV_number());
                }
                System.out.println("您需要支付的租赁费用是："+total_money+"元。");

            }
        }else if(vehicel_type==2){
            //type="";
            System.out.print("请选择你要租赁的汽车品牌：1、金龙 2、金杯");
//            brand=(input.nextInt()==1)?"金龙":"金杯";
            int choose_brand = input.nextInt();
            System.out.print("请选择你要租赁的汽车座位数：1、16座 2、34座");
//            seat=(input.nextInt()==1)?16:34;
            int choose_seat = input.nextInt();
            System.out.print("请输入您要租赁的天数：");
            int days=input.nextInt();
            if (choose_brand == 1){
                if (choose_seat == 1){
                    total_money = bus[1].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是：" + bus[1].getV_number());
                }else if (choose_seat == 2){
                    total_money = bus[3].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是：" + bus[3].getV_number());
                }
            }else if (choose_brand == 2){
                if (choose_seat == 1){
                    total_money = bus[0].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是：" + bus[0].getV_number());
                }else if (choose_seat == 2){
                    total_money = bus[2].totalPrice(days);//租赁费用
                    System.out.println("分配给您的汽车牌号是：" + bus[2].getV_number());
                }
            }
            System.out.println("您需要支付的租赁费用是："+total_money+"元。");
        }



    }


}
